home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 5 / Example 5.4 / camera.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-29  |  759 b   |  36 lines

  1. #ifndef _CAMERA
  2. #define _CAMERA
  3.  
  4. #include <d3dx9.h>
  5. #include "mouse.h"
  6. #include "debug.h"
  7.  
  8. class CAMERA{
  9.     public:
  10.         //Init Camera
  11.         CAMERA();
  12.         void Init(IDirect3DDevice9* Dev);
  13.  
  14.         //Movement
  15.         void Scroll(D3DXVECTOR3 vec);    //Move Focus
  16.         void Pitch(float f);            //Change B-angle
  17.         void Yaw(float f);                //Change A-angle
  18.         void Zoom(float f);                //Change FOV
  19.         void ChangeRadius(float f);        //Change Radius... douh
  20.  
  21.         //Calculate Eye position etc
  22.         void Update(MOUSE &mouse, float timeDelta);
  23.  
  24.         //Calculate Matrices
  25.         D3DXMATRIX GetViewMatrix();
  26.         D3DXMATRIX GetProjectionMatrix();
  27.  
  28.     private:
  29.  
  30.         IDirect3DDevice9* m_pDevice;
  31.         float m_alpha, m_beta, m_radius, m_fov;
  32.         D3DXVECTOR3 m_eye, m_focus, m_right, m_look;
  33. };
  34.  
  35. #endif
  36.